package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/customer/orders")
public class CustomerOrderController {

    @Autowired
    private NursingProjectService nursingProjectService;

    @GetMapping("/project/page")
    @ApiOperation("分页查询护理项目列表")
    public ResponseResult<PageResponse<List<NursingProjectVo>>> queryNursingProjectList(String name, Integer pageNum, Integer pageSize, Integer status){
        PageResponse<NursingProjectVo> pageResponse = nursingProjectService.queryPage(name,pageNum,pageSize,status);
        return ResponseResult.success(pageResponse);
    }

    @GetMapping("/project/{id}")
    @ApiOperation("根据编号查询护理项目信息")
    public ResponseResult<NursingProjectVo> queryNursingProjectById(@PathVariable Long id){
        NursingProjectVo nursingProjectVo = nursingProjectService.getById(id);
        return ResponseResult.success(nursingProjectVo);
    }

}















